<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>进度条</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .head-nav{
            display: flex;
            justify-content: space-between;
            padding: 10px;
            border-bottom: 1px solid #EEF0F4;
        }
        ul li{
            text-align: center;
            margin: 10px;
            padding: 10px;
            border-radius: 40px;
            background: #F7F8FA;
        }

        .progress{
            width: 300px;
            height: 10px;
            border: 1px solid #333;
            border-radius: 5px;
            overflow: hidden;
            box-sizing: border-box;

            margin: 20px;
        }
        .progress .fill{
            width: 10%;
            height: 100%;
            background: #007ACC;
        }
    </style>
</head>
<body>
    <div class="head-nav">
        <div onclick="history.go(-1)">《</div>
        <div>ProgressBar 进度条</div>
        <div></div>
    </div>
    
    <div class="progress">
        <div class="fill"></div>
    </div>
    

    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script>
        function progressBar(num){
            var size = 0;
            var timer = setInterval(function(){
                size+= 0.1;
                if(parseInt(size) != num){
                    $(".progress .fill").css("width",size+"%")
                }else{
                    clearInterval(timer)
                    console.log("stop")
                }
            },10)
        }

        progressBar(50)
    </script>
</body>
</html>